//
//  IComMediator+MessageModuleActions.m
//  ICome
//
//  Created by Administrator on 2016/10/27.
//  Copyright © 2016年 iCom. All rights reserved.
//

#import "IComMediator+MessageModuleActions.h"

//模块的常量
// action 类名 Setting 模块统一用Setting
NSString * const kIComMediatorTargetMessage = @"Message";
// 类对应方法名
NSString * const kIComNativeFetchMessageVController = @"nativeFetchMessageVController";
NSString * const kIComNativeFetchNotifyController = @"nativeFetchNotifyController";
NSString * const kIComNativeFetchNoticeController = @"nativeFetchNoticeController";
NSString * const kIComNativeFetchChnController = @"nativeFetchChnController";
NSString * const kIComNativeFetchServeMessageViewController = @"nativeFetchServeMessageViewController";


@implementation IComMediator (MessageModuleActions)

-(UIViewController *)IComMediator_MessageVController:(NSDictionary *)params{
    UIViewController *viewController = [self performTarget:kIComMediatorTargetMessage
                                                    action:kIComNativeFetchMessageVController
                                                    params:params];
    if ([viewController isKindOfClass:[UIViewController class]]) {
        return viewController;
    } else {
        return [[UIViewController alloc] init];
    }
}

-(UIViewController *)IComMediator_NotifyController:(NSDictionary *)params {
    UIViewController *viewController = [self performTarget:kIComMediatorTargetMessage
                                                    action:kIComNativeFetchNotifyController
                                                    params:params];
    if ([viewController isKindOfClass:[UIViewController class]]) {
        return viewController;
    } else {
        return [[UIViewController alloc] init];
    }
}

-(UIViewController *)IComMediator_NoticeViewController:(NSDictionary *)params {
    UIViewController *viewController = [self performTarget:kIComMediatorTargetMessage
                                                    action:kIComNativeFetchNoticeController
                                                    params:params];
    if ([viewController isKindOfClass:[UIViewController class]]) {
        return viewController;
    } else {
        return [[UIViewController alloc] init];
    }
}

-(UIViewController *)IComMediator_ChnController:(NSDictionary *)params {
    UIViewController *viewController = [self performTarget:kIComMediatorTargetMessage
                                                    action:kIComNativeFetchChnController
                                                    params:params];
    if ([viewController isKindOfClass:[UIViewController class]]) {
        return viewController;
    } else {
        return [[UIViewController alloc] init];
    }
}

-(UIViewController *)IComMediator_ServeMessageViewController:(NSDictionary *)params {
    UIViewController *viewController = [self performTarget:kIComMediatorTargetMessage
                                                    action:kIComNativeFetchServeMessageViewController
                                                    params:params];
    if ([viewController isKindOfClass:[UIViewController class]]) {
        return viewController;
    } else {
        return [[UIViewController alloc] init];
    }
}

@end
